package com.example.chengbangming.chomeapp;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;

import com.example.chengbangming.chomeapp.TabbarFragment.IndexFragment;
import com.example.chengbangming.chomeapp.TabbarFragment.ShopFragment;
import com.example.chengbangming.chomeapp.TabbarFragment.buildHomeFragment;
import com.example.chengbangming.chomeapp.TabbarFragment.selfFragment;
import com.example.chengbangming.chomeapp.TabbarFragment.wisdomFragment;
import com.hjm.bottomtabbar.BottomTabBar;

public class MainActivity extends AppCompatActivity {

    private BottomTabBar mBottombBar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
        setContentView(R.layout.activity_main);
        mBottombBar = (BottomTabBar) findViewById(R.id.bottom_bar);

        mBottombBar.init(getSupportFragmentManager())
                .setImgSize(50,50)
                .setFontSize(8)
                .setTabPadding(4,6,10)
//                .setChangeColor(Color.DKGRAY,Color.RED)
                .addTabItem("首页", R.mipmap.tab_icon_shouye_defaulttwo, IndexFragment.class)
                .addTabItem("智慧全装", R.mipmap.tab_icon_quanzhuang_defaulttwo, wisdomFragment.class)
                .addTabItem("匠心筑家", R.mipmap.tab_icon_zhujia_defaulttwo, buildHomeFragment.class)
                .addTabItem("爱心持家", R.mipmap.tab_icon_shop_defaulttwo, ShopFragment.class)
                .addTabItem("个人中心", R.mipmap.tab_icon_i_defaulttwo, selfFragment.class)
                .setTabBarBackgroundColor(Color.WHITE)
                .isShowDivider(true);

    }
}
